//package src;
import java.awt.*;
import java.awt.geom.Point2D;
import java.io.*;
import java.util.Vector;
import javax.swing.*;


public class Drawing implements Serializable
{
	private Vector saveSpace;
	private Color nowColor;
	
	
	public Drawing(Color init_color) 
	{
		saveSpace = new Vector();
		nowColor = init_color;
	}
	
	public void add(Shape s) 
	{
		saveSpace.add(s);
		
	}
	
	
	public void draw(Graphics g) 
	{
		for (int i = 0; i < saveSpace.size(); i++)
			((Shape) saveSpace.get(i)).draw(g);
	}
	
	public Color getColor() 
	{
		return nowColor;
	}
	
	public void remainEndshape(Shape s) 
	{
		if (saveSpace.size() > 0)
		{
			saveSpace.remove(saveSpace.lastElement());
			saveSpace.add(s);
		}
	}
	
	public Vector getDrawing()
	{
		return saveSpace;
	}

	public void setDrawing(Vector open) 
	{
		saveSpace = open;
	}
}
